/*
 * @Author: '浪川' '1214391613@qq.com'
 * @Date: 2025-08-05 15:05:09
 * @LastEditors: '浪川' '1214391613@qq.com'
 * @LastEditTime: 2025-08-07 14:22:38
 * @FilePath: \passiflora-edulis-sims\src\interfaces\IAdvancedPuzzle.ts
 * @Description: 高级拼图类型的 Store接口和class接口
 *
 * Copyright (c) 2025 by '1214391613@qq.com', All Rights Reserved.
 */
import type { IStrokePaint } from 'leafer-ui'
import type { IGrid, Ipage, IText } from './IBook'

/**
 * @property `type`: 是双重拼图
 */
export interface IDoublePuzzlePage extends Ipage {
  type: 'DoublePuzzle'

  message_text: string

  reveal_letters: string[]
  reveal_letter_style: IText | undefined
  reveal_letter_location: 'outside' | 'inside'

  message_text_style: IGrid | undefined
}

export interface ISolution {
  category: string
  stroke: IStrokePaint
}

/**
 * 单词搜索拼图的高级属性
 * @property number `size`: 评图尺寸
 * @property IText `words_legend`: 单词列表的属性
 * @property string[] `directions`: 搜索方向的设置
 * @property ISolution `solution`: 答案的属性
 * @property number `level`: 拼图等级
 */
export interface IWordSearchFeatures {
  size: number
  words_legend: IText
  directions: string[]
  solution: ISolution
  level: number
}

/**
 * WordSearch 完整的属性
 */
export interface IWordSearchPage extends Ipage, IWordSearchFeatures {}

/**
 * 纵横字谜拼图的高级属性
 * @property Record<string, string> `word`: 纵横字谜的单词字典
 */

export interface ICrosswordFeatures {
  words: Record<string, string>
  legend_type: IText
}

export interface ICrosswordPage extends Ipage, IWordSearchFeatures {}
